You are here: Symbol Reference > Dew Namespace > Dew.Signal Namespace > Dew.Signal.Units Namespace > Classes > SignalUtils Class > SignalUtils Methods > SignalUtils.BandFlip Method
Dew Signal for .NET
ContentsIndexHome
PreviousUpNext
SignalUtils.BandFlip Method

Flip the frequency band.

Syntax
C#
Visual Basic
public static void BandFlip([In] TVec X);

Flip the freqencies of the time domain signal stored in X, so that the DC becomes the Nyquist frequency and the Nyquist frequency becomes the DC. (mirror all frequencies around FS/4) The routine is very fast and can also be used for streaming. X.length must be even.

The sampling frequency is 256 Hz. A tone has a frequency 6Hz. After flipping the frequencies, the tone has a frequency of: FS/2 - 6 = 122Hz.

using Dew.Math; using Dew.Math.Editors; using Dew.Math.Units; using Dew.Signal; using Dew.Signal.Units; using Dew.Math.Tee; using Dew.Signal.Tee; private void button1_Click(object sender, EventArgs e) { Vector b = MtxExpr.Sin(MtxExpr.Ramp(256, TMtxFloatPrecision.mvDouble,0,2*Math.PI*6/256)); Vector c = new Vector(b.Length); Vector Response1 = new Vector(0); Vector Response2 = new Vector(0); c.Copy(b); SignalUtils.BandFlip(b); MtxVecTee.DrawIt(new TVec[2] {c,b}, new string[2] {"Original signal","Flipped signal"},"Band flipped time signal", false); SignalUtils.FrequencyResponse(c, null, Response1, 1, true, TSignalWindowType.wtRectangular, 0); SignalUtils.FrequencyResponse(b, null, Response2, 1, true, TSignalWindowType.wtRectangular, 0); MtxVecTee.DrawIt(new TVec[2] {Response1,Response2}, new string[2] {"Spectrum: original signal","Spectrum: flipped signal"}, "Band flipped frequency spectrum", false); }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!